home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_10_04 / 1004109a < prev    next >
Text File  |  1992-02-08  |  642b  |  27 lines

  1.  
  2. Listing 7
  3. ********
  4.    int find_maximum(one, two, three)      
  5.    int one, two, three;  
  6.       {
  7.       if (one > two)            
  8.            if (one > three)  
  9.                 return one;          
  10.            else
  11.                return three;            
  12.       if (two > three) 
  13.            return two; 
  14.       else
  15.            return three;  
  16.       }
  17.  
  18.    ... or ...     
  19.  
  20.    int find_maximum(one, two, three)      
  21.    int one, two, three;        /*  This could be a macro if you're
  22.                                    careful about side effects. */      
  23.    return ((one>two)?((one>three)?one:three):((two>three)?two:three));       
  24.  
  25. *********
  26.  
  27.